<template>
  <div class="page">
    <div class="page-container">
      <img class="app-logo" :src="mainLogo"/>
      <div class="app-name">22世纪家庭大脑</div>
      <div class="input-wrapper">
        <div class="input-title">账号</div>
        <input class="input-content" @input="inputUsername" :value="username" placeholder="手机号/邮箱/用户名" placeholder-class="input-holder"/>
      </div>
      <div class="input-wrapper">
        <div class="input-title">密码</div>
        <input class="input-content" @input="inputPassword" password="true" :value="password" placeholder="在此输入密码" placeholder-class="input-holder"/>
      </div>
      <div class="confirm" @click="login">登陆</div>
      <div class="author">Powered by 22century</div>
    </div>
  </div> 
</template>

<script>
export default {
  data() {
    return {
      username: null,
      password: null,
      
      mainLogo: '/static/images/logo-copy.png'
    }
  },
  methods: {
    login () {
      wx.redirectTo({
        
          url: '../user/user',
          success: function(res){
              // success
          },
          fail: function() {
              // fail
          },
          complete: function() {
              // complete
          }
      })
    },

    inputUsername () {},

    inputPassword () {},
  }
}
</script>

<style>
  
  .page {
    width: 100%;
    height: 100%;
  }

  .page-container {
    width: 100%;
    height: 100%;
    position: relative;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: -webkit-linear-gradient(-45deg, rgba(72, 0, 121, 0.8), rgba(0, 28, 111, 1));
  }

  .app-logo {
    margin-top: 15%;
    width: 200rpx;
    height: 200rpx;
  }

  .app-name {
    margin-top: 60rpx;
    font-size: 36rpx;
    font-weight: bold;
    color: white;
  }

  .input-wrapper {
    margin-top: 40rpx;
    width: 560rpx;
    height: 80rpx;
    border-radius: 20rpx;
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.2);
  }

  .input-title {
    width: 100rpx;
    height: 60rpx;
    margin-left: 10rpx;
    line-height: 60rpx;
    text-align: center;
    font-weight: 28rpx;
    color: rgba(255, 255, 255, 0.7);
    border-right: 4rpx solid rgba(235, 235, 235, 0.1);
  }

  .input-content {
    line-height: 80rpx;
    margin-left: 20rpx;
    color: white;
  }

  .input-holder {
    font-size: 28rpx;
    color: white;
    opacity: 0.3;
  }

  .confirm {
    margin-top: 100rpx;
    width: 360rpx;
    height: 80rpx;
    border-radius: 40rpx;
    line-height: 80rpx;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 34rpx;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.2);
    -webkit-transition: all 0.2s ease;
  }

  .confirm:active {
    background-color: rgba(255, 255, 255, 0.7);
    color: white;
  }

  .author {
    margin-top: auto;
    margin-bottom: 20rpx;
    color: white;
    opacity: 0.4;
    font-size: 24rpx;
  }
</style>
